package test.study.nosql.json;

import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

@Accessors(chain = true)
@Data
public class UserInfo {
    private Long userId;
    private String username;
    private Date birthday;

    private TeachSubject techSubject;

    private List<GrantedAuthority> authorities;

    public static UserInfo newUserInfo() {
        return new UserInfo()
                .setUserId(10001L)
                .setUsername("张三")
                .setBirthday(new Date())
                .setTechSubject(TeachSubject.newTechSubject())
                .setAuthorities(GrantedAuthority.authList(3));
    }
}
